<template>
    <div class="classicitem">
        <div class="image"> <slot></slot></div>
        <div class="delete" @click="handleDeleteImage"><img src="@/assets/images/base-images/我的-案例-删除.png" alt=""></div>
    </div>
</template>

<script>
import {delete_image} from '@/network/request.js';
    export default {
        props: {
            item_id: {
                type: Number,
                default(){
                    return null
                }
            }
        },
        methods: {
            async handleDeleteImage() {
                const res  = await delete_image({
                   url:"api/user/delete_classic",
                   data:{
                        id:this.item_id
                   }  
                })
                // console.log(this.item_id);
                // console.log(res);
                this.$emit("handleDelete")
            }
        },
    }
</script>

<style  scoped>
.classicitem{
    margin-bottom: 15px;
    position: relative;
}
.image{
    width: 100px;
    height: 100px;
}
.image img{
    vertical-align: middle;
    width: 100px;
    height: 100px;
}
.delete{
    position: absolute;
    bottom: 7px;
    right: 7px;
}
.delete img{
    vertical-align: middle;
    width: 25px;
    height: 25px;
}
</style>